package com.coship.vasms.adstorm.common;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class DateHelper {
	public static SimpleDateFormat dateformat = new SimpleDateFormat(
			"MM-dd HH:mm");
	public static SimpleDateFormat dateformat1 = new SimpleDateFormat(
			"yyyy-MM-dd HH:mm");
	public static SimpleDateFormat dateformatDate = new SimpleDateFormat(
			"yyyy-MM-dd");
	public static SimpleDateFormat dateformatDateTime = new SimpleDateFormat(
			"yyyy-MM-dd HH:mm");
	public static SimpleDateFormat dateFormatSecond = new SimpleDateFormat(
			"yyyy-MM-dd HH:mm:sss");

	//私有化构造函数
	private DateHelper(){}
	/**
	 * 取得当前日期,格式为：yyyy-MM-dd
	 * 
	 * @return
	 */
	public static String getDate() {
		String time = dateformatDate.format(new java.util.Date());
		return time;
	}

	/**
	 * 取得当前日期,格式为：yyyy-MM-dd HH:mm:sss
	 * 
	 * @return
	 */
	public static String getCurrentSecond() {
		String time = dateFormatSecond.format(new java.util.Date());
		return time;
	}

	/**
	 * 
	 * @return
	 */
	public static String getDate(Integer n) {
		Calendar cal = Calendar.getInstance();
		cal.setTime(new Date());
		cal.add(Calendar.DAY_OF_MONTH, n);
		return dateformatDate.format(cal.getTime());
	}

	/**
	 * 取得后天
	 * 
	 * @return
	 */
	public static String getAfterTomorrow() {
		Calendar cal = Calendar.getInstance();
		cal.setTime(new Date());
		cal.add(Calendar.DAY_OF_MONTH, 2);
		return dateformatDate.format(cal.getTime());
	}
}
